.class public abstract Lcom/burstly/lib/component/AbstractAdaptor;
.super Ljava/lang/Object;
.source "AbstractAdaptor.java"

# interfaces
.implements Lcom/burstly/lib/component/IBurstlyAdaptor;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/burstly/lib/component/AbstractAdaptor$AdaptorListenerWrapper;
    }
.end annotation


# static fields
.field protected static final LOG:Lcom/burstly/lib/util/LoggerExt;

.field private static final MOCK_LISTENER:Lcom/burstly/lib/component/IBurstlyAdaptorListener;


# instance fields
.field private mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

.field private final mContext:Landroid/content/Context;

.field private mHardwareAccelerationFlag:Ljava/lang/Boolean;

.field private volatile mIsDestroyed:Z

.field private volatile mIsStopped:Z

.field private mLayoutParamsResolver:Lcom/burstly/lib/component/LayoutParametersResolver;

.field private mParamsFromServer:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;"
        }
    .end annotation
.end field

.field protected mTag:Ljava/lang/String;

.field private final mViewId:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 37
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 43
    new-instance v0, Lcom/burstly/lib/component/AbstractAdaptor$1;

    invoke-direct {v0}, Lcom/burstly/lib/component/AbstractAdaptor$1;-><init>()V

    sput-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->MOCK_LISTENER:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 0
    .parameter "context"
    .parameter "viewId"

    .prologue
    .line 185
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 186
    iput-object p1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mContext:Landroid/content/Context;

    .line 187
    iput-object p2, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mViewId:Ljava/lang/String;

    .line 188
    return-void
.end method


# virtual methods
.method protected abstract checkParameters(Ljava/util/Map;)V
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation
.end method

.method public destroy()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 192
    invoke-virtual {p0}, Lcom/burstly/lib/component/AbstractAdaptor;->stop()V

    .line 193
    iput-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    .line 194
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mIsDestroyed:Z

    .line 195
    iput-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mParamsFromServer:Ljava/util/Map;

    .line 196
    iput-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mLayoutParamsResolver:Lcom/burstly/lib/component/LayoutParametersResolver;

    .line 197
    return-void
.end method

.method protected abstract doGetNewAd()Landroid/view/View;
.end method

.method public endTransaction(Lcom/burstly/lib/component/IBurstlyAdaptor$TransactionCode;)V
    .locals 5
    .parameter "endCode"

    .prologue
    .line 306
    sget-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mTag:Ljava/lang/String;

    const-string v2, "End transaction code: {0} for adaptor {1}"

    const/4 v3, 0x2

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p1, v3, v4

    const/4 v4, 0x1

    aput-object p0, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 307
    return-void
.end method

.method public endViewSession()V
    .locals 5

    .prologue
    .line 350
    sget-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mTag:Ljava/lang/String;

    const-string v2, "endViewSession() for {0}"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p0, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 351
    return-void
.end method

.method public getAdaptorListener()Lcom/burstly/lib/component/IBurstlyAdaptorListener;
    .locals 1

    .prologue
    .line 233
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    :goto_0
    return-object v0

    :cond_0
    sget-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->MOCK_LISTENER:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    goto :goto_0
.end method

.method protected getContext()Landroid/content/Context;
    .locals 1

    .prologue
    .line 242
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method protected getLayoutParamsResolver()Lcom/burstly/lib/component/LayoutParametersResolver;
    .locals 1

    .prologue
    .line 301
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mLayoutParamsResolver:Lcom/burstly/lib/component/LayoutParametersResolver;

    return-object v0
.end method

.method public final getNewAd()Landroid/view/View;
    .locals 1

    .prologue
    .line 256
    invoke-virtual {p0}, Lcom/burstly/lib/component/AbstractAdaptor;->doGetNewAd()Landroid/view/View;

    move-result-object v0

    .line 257
    .local v0, bannerView:Landroid/view/View;
    invoke-virtual {p0, v0}, Lcom/burstly/lib/component/AbstractAdaptor;->setHardwareAcceleration(Landroid/view/View;)V

    .line 258
    return-object v0
.end method

.method protected getParamsFromServer()Ljava/util/Map;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;"
        }
    .end annotation

    .prologue
    .line 313
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mParamsFromServer:Ljava/util/Map;

    return-object v0
.end method

.method protected getViewId()Ljava/lang/String;
    .locals 1

    .prologue
    .line 251
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mViewId:Ljava/lang/String;

    return-object v0
.end method

.method protected isDestroyed()Z
    .locals 1

    .prologue
    .line 338
    iget-boolean v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mIsDestroyed:Z

    return v0
.end method

.method public isStopped()Z
    .locals 1

    .prologue
    .line 331
    iget-boolean v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mIsStopped:Z

    return v0
.end method

.method public pause()V
    .locals 0

    .prologue
    .line 207
    return-void
.end method

.method public precacheInterstitialAd()V
    .locals 0

    .prologue
    .line 319
    return-void
.end method

.method public resume()V
    .locals 0

    .prologue
    .line 212
    return-void
.end method

.method public setAdaptorListener(Lcom/burstly/lib/component/IBurstlyAdaptorListener;)V
    .locals 1
    .parameter "listener"

    .prologue
    .line 216
    new-instance v0, Lcom/burstly/lib/component/AbstractAdaptor$AdaptorListenerWrapper;

    invoke-direct {v0, p0, p1}, Lcom/burstly/lib/component/AbstractAdaptor$AdaptorListenerWrapper;-><init>(Lcom/burstly/lib/component/AbstractAdaptor;Lcom/burstly/lib/component/IBurstlyAdaptorListener;)V

    iput-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    .line 217
    return-void
.end method

.method protected setHardwareAcceleration(Landroid/view/View;)V
    .locals 6
    .parameter "view"

    .prologue
    .line 267
    if-eqz p1, :cond_0

    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mHardwareAccelerationFlag:Ljava/lang/Boolean;

    if-eqz v0, :cond_0

    .line 268
    sget-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mTag:Ljava/lang/String;

    const-string v2, "Setting hardware acceleration to {0}"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mHardwareAccelerationFlag:Ljava/lang/Boolean;

    aput-object v5, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 269
    iget-object v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mHardwareAccelerationFlag:Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    invoke-static {p1, v0}, Lcom/burstly/lib/util/Utils;->setHardwareAcceleration(Landroid/view/View;Z)V

    .line 271
    :cond_0
    return-void
.end method

.method public showPrecachedInterstitialAd()V
    .locals 0

    .prologue
    .line 324
    return-void
.end method

.method public startTransaction(Ljava/util/Map;)V
    .locals 5
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .prologue
    .line 282
    .local p1, paramsFromServer:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;*>;"
    if-nez p1, :cond_0

    .line 283
    new-instance v1, Ljava/lang/IllegalArgumentException;

    const-string v2, "Error parsed response!"

    invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 285
    :cond_0
    iput-object p1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mParamsFromServer:Ljava/util/Map;

    .line 286
    const-string v1, "componentState"

    invoke-interface {p1, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/component/ComponentState;

    .line 287
    .local v0, state:Lcom/burstly/lib/component/ComponentState;
    const-string v1, "state can not be null"

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 288
    const-string v1, "OverrideHardwareAccelerationTo"

    invoke-interface {p1, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Boolean;

    iput-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mHardwareAccelerationFlag:Ljava/lang/Boolean;

    .line 290
    new-instance v1, Lcom/burstly/lib/component/LayoutParametersResolver;

    invoke-virtual {v0}, Lcom/burstly/lib/component/ComponentState;->getFullResponse()Lcom/burstly/lib/network/beans/ResponseBean;

    move-result-object v2

    invoke-virtual {v0}, Lcom/burstly/lib/component/ComponentState;->getResponseData()Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;

    move-result-object v3

    iget-object v4, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mTag:Ljava/lang/String;

    invoke-direct {v1, v2, v3, v4}, Lcom/burstly/lib/component/LayoutParametersResolver;-><init>(Lcom/burstly/lib/network/beans/ResponseBean;Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mLayoutParamsResolver:Lcom/burstly/lib/component/LayoutParametersResolver;

    .line 291
    iget-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mLayoutParamsResolver:Lcom/burstly/lib/component/LayoutParametersResolver;

    iget-object v2, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mContext:Landroid/content/Context;

    invoke-static {v2}, Lcom/burstly/lib/util/Utils;->getScale(Landroid/content/Context;)F

    move-result v2

    invoke-virtual {v1, v2}, Lcom/burstly/lib/component/LayoutParametersResolver;->setScale(F)V

    .line 292
    invoke-virtual {p0, p1}, Lcom/burstly/lib/component/AbstractAdaptor;->checkParameters(Ljava/util/Map;)V

    .line 293
    return-void
.end method

.method public startViewSession()V
    .locals 5

    .prologue
    .line 344
    sget-object v0, Lcom/burstly/lib/component/AbstractAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mTag:Ljava/lang/String;

    const-string v2, "startViewSession() for {0}"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p0, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 345
    return-void
.end method

.method public stop()V
    .locals 1

    .prologue
    .line 201
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/component/AbstractAdaptor;->mIsStopped:Z

    .line 202
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 1

    .prologue
    .line 355
    invoke-virtual {p0}, Lcom/burstly/lib/component/AbstractAdaptor;->getNetworkName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
